package com.iot.ic.utils;

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import com.iot.ic.model.TeamInfo;





public class MyComparator implements Comparator<TeamInfo> {

	
	@Override
	public int compare(TeamInfo o1, TeamInfo o2) {
		 Collator instance = Collator.getInstance(Locale.CHINA);  
         return instance.compare(o1.getTeamName(), o2.getTeamName()); 
	}
	
	 public static void main(String[] args) {
		   List<TeamInfo> list = new ArrayList<TeamInfo>();
		   TeamInfo stud1=new TeamInfo();
	        stud1.setTeamName("啊");
	        TeamInfo stud2=new TeamInfo();
	        stud2.setTeamName("在");
	        TeamInfo stud3=new TeamInfo();
	        stud3.setTeamName("不");
	      

	        list.add(stud1);
	        list.add(stud2);
	        list.add(stud3);
	        

	        Collections.sort(list, new MyComparator()); 
	        for(TeamInfo stud:list){
	            System.out.println(stud.getTeamName());
	        }
	    }
}